import Vue from 'vue'
import VueRouter from 'vue-router'
// 路由视图 


const index = () => import('../views/index.vue') //首页
const order = () => import('../views/order.vue') //订单
const profile = () => import('../views/profile.vue') //我的页面
const category = () => import('../views/category.vue')
const routes = [
  {
    path: '/',
    name: '首页',
    component: index,
    redirect: "index"
  },
  {
    path: '/index',
    name: 'index',
    component: index
  },
  {
    path: '/order',
    name: '订单',
    component: order
  },
  {
    path: '/profile',
    name: '我的',
    component: profile
  },
   {
    path: '/category',
    name: '分类',
    component: category
  },
]
Vue.use(VueRouter)
const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
